package org.xlh.springboot.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.xlh.springboot.service.UserService;

@Slf4j
@RestController
public class UserController {

    @Autowired
    private UserService userService;
    @GetMapping("/test/log")
    public String user() {
        log.trace("这是UserController的trace日志");
        log.info("这是UserController的info日志");
        log.debug("这是UserController的debug日志");
        log.warn("这是UserController的warn日志");
        log.error("这是UserController的error日志");
        return userService.findById();
    }
}
